package com.example.service;

import com.example.entity.User;
import com.example.mapper.UserMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {
    @Resource
    public UserMapper userMapper;

    public List<User> getAllUsers() {
        return userMapper.getAllUsers();
    }


    public int updateById(User user) {
        return userMapper.updateByid(user);
    }


    public int addUser(User user) {
        return userMapper.addUser(user);
    }

    public List<User> getUserByName(String username) {
        return userMapper.getUserByName(username);
    }
}
